'\" te
.\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved.
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
.\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH PSET_SETATTR 2 "February 21, 2023"
.SH NAME
pset_setattr, pset_getattr \- set or get processor set attributes
.SH SYNOPSIS
.nf
#include <sys/pset.h>

\fBint\fR \fBpset_setattr\fR(\fBpsetid_t\fR \fIpset\fR, \fBuint_t\fR \fIattr\fR);
.fi

.LP
.nf
\fBint\fR \fBpset_getattr\fR(\fBpsetid_t\fR \fIpset\fR, \fBuint_t *\fR\fIattr\fR);
.fi

.SH DESCRIPTION
The \fBpset_setattr()\fR function sets attributes of the processor set
specified by \fIpset\fR.  The bitmask of attributes to be set or cleared is
specified by \fIattr\fR.
.sp
.LP
The pset_getattr function returns attributes of the processor set specified by
\fIpset\fR. On successful return, \fIattr\fR will contain the bitmask of
attributes for the specified processor set.
.sp
.LP
The value of the \fIattr\fR argument is the bitwise inclusive-OR of these
attributes, defined in <\fBsys/pset.h\fR>:
.sp
.ne 2
.na
\fB\fBPSET_NOESCAPE\fR\fR
.ad
.RS 17n
Unbinding of LWPs from the processor set with this attribute requires the
{\fBPRIV_SYS_RES_CONFIG\fR} privilege to be asserted in the effective set of
the calling process.
.RE

.sp
.LP
The binding of LWPs and processes to processor sets is controlled by
\fBpset_bind\fR(2). When the \fBPSET_NOESCAPE\fR attribute is cleared, a
process calling \fBpset_bind()\fR can clear the processor set binding of any
LWP whose real or effective user ID matches its own real of effective user ID.
Setting \fBPSET_NOESCAPE\fR attribute forces \fBpset_bind()\fR to requires the
{\fBPRIV_SYS_RES_CONFIG\fR} privilege to be asserted in the effective set of
the calling process.
.SH RETURN VALUES
Upon successful completion, these functions return 0. Otherwise, -1 is returned
and \fBerrno\fR is set to indicate the error.
.SH ERRORS
These function will fail if:
.sp
.ne 2
.na
\fB\fBEFAULT\fR\fR
.ad
.RS 11n
The location pointed to by \fIattr\fR was not writable by the user.
.RE

.sp
.ne 2
.na
\fB\fBEINVAL\fR\fR
.ad
.RS 11n
An invalid processor set ID was specified.
.sp
The caller is in a non-global zone, the pools facility is active, and the
processor is not a member of the zone's pool's processor set.
.RE

.sp
.ne 2
.na
\fB\fBENOTSUP\fR\fR
.ad
.RS 11n
The pools facility is active. See \fBpooladm\fR(8) and
\fBpool_set_status\fR(3POOL) for information about enabling and disabling the
pools facility.
.RE

.SH ATTRIBUTES
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Stable
_
MT-Level	Async-Signal-Safe
.TE

.SH SEE ALSO
.BR pset_bind (2),
.BR pool_set_status (3POOL),
.BR attributes (7),
.BR pooladm (8),
.BR psrset (8),
.BR zoneadm (8)
